import { done } from 'nprogress';
import{get,post,$setToken}from'../util/request'



//定义一个插件
export default{
install:function(vue){
    vue.mixin({
        methods: {
            $get(url,params){
                return get(url,params)

            },
            $post(url,params){
                return post(url,params)
            },
            // $setToken(){
            //     $setToken()
      
    $msg_s(message,duration=3000){
        this.$message({
         showClose: true,
         message,
         type:"success",
         duration
        });
    },
    $msg_w(message,duration=3000){
        this.$message({
         showClose: true,
         message,
         type:"warning",
         duration
        });
    },
    //成功消息框
    $msg_w(message,duration=3000){
        this.$message({
            
         showClose: true,
         message,
         type:"warning",
          duration,
        });
    },
    $msg_e(message,duration=3000){
        this.$message({
           
         showClose: true,
         message,
         type:"error",
          duration,
        });
    },
    $con_f(message){
     
         return this.$confirm(message)
         .then(res => {
          return ture
         }
         )
         .catch((_) => {});
     
    }
},
    });

},
}